#include <wx/panel.h>
#include <wx/button.h>
#include <wx/listctrl.h>
#include <wx/combobox.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/textdlg.h>
#include <wx/msgdlg.h>
#include <wx/filedlg.h>
#include <wx/wfstream.h>
#include <wx/progdlg.h>
#include "DataServer.h"
#include "AddItemDialog.h"
#include "ImportDataDialog.h"

class ExamManager : public wxPanel
{
public:
	ExamManager(wxWindow* parent,wxWindowID winID,std::shared_ptr<DataServer> data);
	~ExamManager();
private:
	wxComboBox* comSelectExam;
	wxButton* btnGetExam;
	wxButton* btnAddExamItem;
	wxButton* btnDelExamItem;
	wxButton* btnAddExam;
	wxButton* btnImportOutsideData;
	ImportDataDialog* importDataDlg;
	wxProgressDialog* LoadingDlg;
	wxListCtrl* listDataView;
	std::unique_ptr<wxMessageDialog> msgDlg;
	unsigned int maxID;
	std::string currentExam;
	std::unique_ptr<AddItemDialog> addDialog;
	
	void onClick_btnGetExam(wxCommandEvent& event);
	void onClick_btnAddExam(wxCommandEvent& event);
	void onClick_btnAddExamItem(wxCommandEvent& event);
	void onClick_btnDelExamItem(wxCommandEvent& event);
	void onClick_btnImportOutsideData(wxCommandEvent& event);

	std::shared_ptr<DataServer> dataS;
	void getExamlist();
	wxDECLARE_EVENT_TABLE();
};

enum class ExamMangerID :int
{
	btnGetExam,
	btnAddExamItem,
	btnDelExamItem,
	listDataView,
	comSelectExam,
	btnAddExam,
	btnDelStud,
	btnImportOutsideData
};